ArrayList in vb.net
207223-Dec-2015
I want to use ArrayList in vb.net please help me.
Updated on 06-Jul-2023
Home / DeveloperSection / Forums / ArrayList in vb.net
Aryan Kumar
06-Jul-2023ArrayList is a generic collection in VB.NET that can store a dynamically sized list of objects. It is similar to an array, but it does not have a fixed size. This means that you can add or remove items from an ArrayList without having to resize it.
To use ArrayList in VB.NET, you need to import the
System.Collections.ArrayList
namespace. You can then create a new ArrayList object and add items to it.Here is an example of how to use ArrayList in VB.NET:
VB.Net
This code will create a new ArrayList object and add three items to it. The code will then get the number of items in the ArrayList and display the contents of the ArrayList on the console.
Here are some of the advantages of using ArrayList in VB.NET:
Here are some of the disadvantages of using ArrayList in VB.NET:
Overall, ArrayList is a versatile and easy-to-use collection in VB.NET. It is a good choice for storing a dynamically sized list of objects.
Anonymous User
23-Dec-2015It represents an ordered collection of an object that can be indexed individually. It is basically an alternative to an array. However, unlike array, you can add and remove items from a list at a specified position using an index and the array resizes itself automatically. It also allows dynamic memory allocation, adding, searching and sorting items in the list.